package com.chinasofti.polymorphic.demo03;

public class Test01 {
    public static void userAnimal(Animal a){
        a.eat();
        if (a instanceof Dog){
            ((Dog) a).wachHome();
        }

    }
    public static void main(String[] args) {

        userAnimal(new Dog());
        userAnimal(new Cat());
    }
}
